﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainFrm.Master" AutoEventWireup="true" CodeBehind="UserAdmin.aspx.cs" Inherits="DataLib.Accounts.UserAdmin" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link href="/Css/tab2.css" rel="Stylesheet" type="text/css" />
    <style type="text/css">
        td
        {
            height: 25px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="EwtsConext" runat="server">
<div class="tab2">
	<h1>用 户 管 理</h1>
    <table class=""  cellpadding="0" width="100%"   border="0" cellspacing="0">
        <!--一个表单-->
        <div class="one">
    	    <tr>
                <td height="22" valign="middle">
                    &nbsp;&nbsp; 快速查询：
                    <asp:DropDownList ID="DropUserType" runat="server" AutoPostBack="True">
                        <asp:ListItem Selected="True" Value="0">内部用户</asp:ListItem>
                        <asp:ListItem Value="1">IT部</asp:ListItem>
                        <asp:ListItem Value="2">仓库</asp:ListItem>
                        <asp:ListItem Value="3">市场部</asp:ListItem>
                        <asp:ListItem Value="4">客户</asp:ListItem>
                    </asp:DropDownList>&nbsp;
                    <asp:Label ID="Label1" runat="server">用户名关键字：</asp:Label>
                    <asp:TextBox ID="TextBox1" runat="server" Width="100px" BorderStyle="Groove">
                    </asp:TextBox>
                    <asp:Button ID="BtnSearch" runat="server" OnClick="BtnSearch_Click" Text="查询">
                    </asp:Button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <a href="UserAdd.aspx">【添加新用户】</a>
                </td>
            </tr>
        </div>
    </table>

    <div class="one">
        <table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
            <tr id="TrGrid" runat="server">
                <td align="left">
                    ○ 页次：<asp:Label ID="lblpage" runat="server" ForeColor="#E78A29"></asp:Label>/
                    <asp:Label ID="lblpagesum" runat="server"></asp:Label>，共：
                    <font color="#e78a29">
                        <asp:Label ID="lblrowscount" runat="server"></asp:Label>
                    </font>条
                </td>
                <td align="right">
                    <asp:LinkButton ID="btnFirst" runat="server" ForeColor="#E78A29"                                             OnCommand="NavigateToPage" CommandArgument="First" CommandName="Pager" Text="首 页">
                    [首 页]</asp:LinkButton>
                    <asp:LinkButton ID="btnPrev" runat="server" ForeColor="#E78A29" nCommand="NavigateToPage"                    CommandArgument="Prev" CommandName="Pager" Text="上一页">[上一页]
                    </asp:LinkButton>
                    <asp:LinkButton ID="btnNext" runat="server" ForeColor="#E78A29"                                              OnCommand="NavigateToPage" CommandArgument="Next" CommandName="Pager" Text="下一页">
                    [下一页]</asp:LinkButton>
                    <asp:LinkButton ID="btnLast" runat="server" ForeColor="#E78A29"                                              OnCommand="NavigateToPage" CommandArgument="Last" CommandName="Pager" Text="尾 页">
                    [尾 页]</asp:LinkButton>
                </td>
            </tr>
            <tr><td></td></tr>
        </table>
    </div>


<div class="one">
    <table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
        <tr>
            <td>
                <asp:DataGrid ID="DataGrid1" runat="server" Width="100%" AutoGenerateColumns="False"
                AllowPaging="True" HorizontalAlign="Center" 
                    PageSize="20"                                                    
                    onitemcommand="DataGrid1_ItemCommand1" onitemcreated="DataGrid1_ItemCreated1" 
                    onpageindexchanged="DataGrid1_PageIndexChanged">
                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                <Columns>
                    <asp:TemplateColumn HeaderText="编号">
                        <HeaderStyle HorizontalAlign="Center" Width="30px"></HeaderStyle>
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        <ItemTemplate>
                            <%# DataGrid1.CurrentPageIndex*DataGrid1.PageSize+DataGrid1.Items.Count+1 %>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn SortExpression="UserID" HeaderText="用户名">
                        <ItemTemplate>
                            <a href='RoleAssignment.aspx?UserID=<%# 
                            DataBinder.Eval(Container, "DataItem.UserID") %>
                            &PageIndex=<%# DataGrid1.CurrentPageIndex %>'>
                                <%# DataBinder.Eval(Container, "DataItem.UserName") %>
                            </a>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn DataField="TrueName" SortExpression="TrueName" ReadOnly="True"                              HeaderText="真实姓名">
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="Sex" SortExpression="Sex" ReadOnly="True" HeaderText="性别">
                        <HeaderStyle Width="30px"></HeaderStyle>
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="Phone" ReadOnly="True" HeaderText="联系电话">
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="Email" ReadOnly="True" HeaderText="电子邮件">
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="companyCity" HeaderText="归属地"></asp:BoundColumn>
                      <asp:BoundColumn DataField="Department" HeaderText="部门"></asp:BoundColumn>
                    <asp:TemplateColumn HeaderText="修改">
                        <HeaderStyle Width="30px"></HeaderStyle>
                        <ItemTemplate>
                            <asp:ImageButton ID="BtnEdit" runat="server" 
                            ImageUrl="\images\icons\button_edit.gif" CommandName="BtnEdit">
                            </asp:ImageButton>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="删除">
                        <HeaderStyle Width="30px"></HeaderStyle>
                        <ItemTemplate>
                            <asp:ImageButton ID="BtnDel" runat="server" 
                            ImageUrl="\images\icons\button_del.gif" CommandName="BtnDel">
                        </asp:ImageButton>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn Visible="False" DataField="UserID" ReadOnly="True" HeaderText="用户ID">
                        <HeaderStyle Width="30px"></HeaderStyle>
                    </asp:BoundColumn>
                </Columns>
                <PagerStyle Font-Size="Medium" HorizontalAlign="Right" Wrap="False" Mode="NumericPages">
                </PagerStyle>
                </asp:DataGrid>
            </td>
        </tr>
    </table>
</div>
</div>
</asp:Content>
